//
//  LSZQueryResultsTableViewCell.m
//  PartyClassCloud
//
//  Created by 梁素珍 on 2018/10/12.
//  Copyright © 2018年 九酷. All rights reserved.
//

#import "LSZQueryResultsTableViewCell.h"

@implementation LSZQueryResultsTableViewCell
-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.imageViewIcon = [[UIImageView alloc]init];
        self.imageViewIcon.frame = CGRectMake(10, 10, 100, 80);
        [self addSubview:self.imageViewIcon];
        
        self.labelTitle = [[UILabel alloc]init];
        self.labelTitle.textColor = titleColorLSZ;
        self.labelTitle.frame = CGRectMake(CGRectGetMaxX(self.imageViewIcon.frame)+10, CGRectGetMinY(self.imageViewIcon.frame)+5, ScreenWidth-self.imageViewIcon.frame.size.width-80, 20);
        self.labelTitle.font = FONT_(14);
        [self addSubview:self.labelTitle];
        
        self.labelContent = [[UILabel alloc]init];
        self.labelContent.frame = CGRectMake(CGRectGetMaxX(self.imageViewIcon.frame)+10, CGRectGetMaxY(self.imageViewIcon.frame)-20-5, self.labelTitle.frame.size.width, 20);
        self.labelContent.textColor = lightColor;
        self.labelContent.font = FONT_(14);
        [self addSubview:self.labelContent];
        
        self.labelMark = [[UILabel alloc]init];
        self.labelMark.frame = CGRectMake(ScreenWidth-70, 35, 60, 30);
        self.labelMark.textColor = titleColorLSZ;
        self.labelMark.font = FONT_(16);
        self.labelMark.textAlignment = NSTextAlignmentRight;
        [self addSubview:self.labelMark];
    }
    return self;
}
-(void)setChenJiMg:(LSZChenJiMg *)chenJiMg
{
    [self.imageViewIcon sd_setImageWithURL:[NSURL URLWithString:chenJiMg.coverUrl] placeholderImage:[UIImage imageNamed:@"默认"]];
    self.labelTitle.text = chenJiMg.name;
    self.labelContent.text = chenJiMg.summary;
    self.labelMark.text = [NSString stringWithFormat:@"%@分",chenJiMg.score];
}

@end
